#!/usr/bin/perl -w

while(<STDIN>){
	chomp;
	@hex = split(/ /,$_);
	
	# $14,$13,$18,$17
	$coords = "geo fix " .  hex($hex[13]) . "." . hex($hex[12]) . " " . hex($hex[17]) . "." . hex($hex[16]);
	print $coords;
	print "\n";

	print "Sending coords to Android Device \n";

	system(`echo $coords | /bin/nc localhost 5554`);
	sleep(5);
}
